package ren.steve.system.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: LiuGuoJia
 * @Description:
 * @Date: Created in 2024/1/18 17:51
 */

@Configuration
public class MyBatisPlusConfig {

  @Bean
  public MybatisPlusInterceptor addPaginationInnerInterceptor () {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    // 向 MyBatis 过滤器链中添加分页拦截器
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return interceptor;
  }

}
